var businessmen = new Vue({

    el: "#businessmen",

    data: {
        //商家信息列表
        merchantList: [],
        options:[],
    },
    //提交时间方法
    methods: {
        //查看商品信息
        showGoods: function (commodityId) {
            $.post("/home/merchant/selectCommodity",
                {"businessesId": commodityId},
                function (data) {
                    $("#wrap-left").load("/person/showGoodsList.html", function () {
                        showGoodsList.shopId.id = commodityId;
                        var CommodityList1 = [];
                        var CommodityList2 = [];
                        var CommodityList3 = [];
                        var CommodityList4 = [];
                        for(var i=0;i<data.data.CommodityList.length;i++){
                            if(data.data.CommodityList[i].install==0){
                                CommodityList1.push(data.data.CommodityList[i]);
                                continue;
                            }else if(data.data.CommodityList[i].install==1){
                                CommodityList2.push(data.data.CommodityList[i]);
                                continue;
                            }else if(data.data.CommodityList[i].install==2){
                                CommodityList3.push(data.data.CommodityList[i]);
                                continue;
                            }else if(data.data.CommodityList[i].install==3){
                                CommodityList4.push(data.data.CommodityList[i]);
                                continue;
                            }
                        }
                        showGoodsList.CommodityList1 = CommodityList1;
                        showGoodsList.CommodityList2 = CommodityList2;
                        showGoodsList.CommodityList3 = CommodityList3;
                        showGoodsList.CommodityList4 = CommodityList4;
                    });


                });


        },
        //添加商品信息
        addGoods: function (merchant) {
            $("#wrap-left").load("/person/addMerchandise.html", function () {
                addMerchandise.merchant = merchant;
            });
        },
        //修改商家信息
        updateGoods: function (sire) {
            var _this = this;
                $("#wrap-left").load("/person/updatesellinformation.html", function () {
                    updatesellinformation.Merchant=sire;
                    $("#distpicker").distpicker({
                        province: sire.affiliatedRegional.split("-")[0],
                        city: sire.affiliatedRegional.split("-")[1],
                        district: sire.affiliatedRegional.split("-")[2]
                    });
                });

        },
    },
    //页面加载后的初始化方法
    created: function () {
        var _this = this;
        //图片名称赋值方法picture
        $(".el-upload__input").change(function(){

        });
    }
});